<template>
  <span v-if="invisible"></span>

  <div v-else-if="widget_todo">{{ [field.type, fname, widget] }}</div>

  <div v-else-if="type === 'cell'">
    <van-form>
      <van-field readonly>
        <template #label>
          <OLabel :data-info="dataInfo" :view-info="viewInfo" />
        </template>

        <template #input>
          <!-- {{ required || 'undifined' }} -->
          {{ value_display }}
        </template>
      </van-field>
    </van-form>
  </div>

  <WInteger
    v-else
    :value_readonly="value_readonly"
    :value_edit="value_edit"
    :editable="editable"
    :data-info="dataInfo"
    :view-info="{ ...viewInfo, node }"
    @on-change="onchange"
  />
</template>

<script>
import OFMixin from './OFMixin'
import OLabel from '../OLabel.vue'

import WInteger from './WInteger.vue'

export default {
  name: 'OInteger',
  components: { OLabel, WInteger },
  mixins: [OFMixin],
  props: {},
  data() {
    return {}
  },
  computed: {
    widget_todo() {
      // 'color_picker'
      const done = ['color_picker']
      return done.includes(this.widget) ? '' : this.widget
    },

    value_readonly() {
      return this.record[this.fname] || 0
    }
  },

  watch: {},

  created() {},

  mounted() {},

  methods: {}
}
</script>

<style type="text/css"></style>
